package connexion;
import grid.items.Body;

import java.awt.Point;
import java.io.IOException;
import java.io.Serializable;
import java.util.Map;



public class PerceptionMessage extends PlacementMessage implements Serializable {

	public static final Object AGENTS_KILLED = "agents killed";
	Map<Body,Point>entities;
	public PerceptionMessage(String agt, Point pos,Map<Body,Point>entities) {
		super(agt,PlacementMessage.PERCEPTION, pos);
		this.entities=entities;
	}
	
	public Map<Body,Point> getEntities()
	{
		return entities;
	}
	
	 protected void writeObject(java.io.ObjectOutputStream out)
     throws IOException
     {
		 super.writeObject(out);
		 out.writeObject(entities);
     }
 protected void readObject(java.io.ObjectInputStream in)
     throws IOException, ClassNotFoundException{
	 super.readObject(in);
	 entities=(Map<Body, Point>)in.readObject();

 }
 
 public String toString()
 {
	 return super.toString()+" sensed : "+entities;
 }



}
